     function queryUserForm(pageIndex,pageSize)
     {
          var url =base+"/userMain/userList.do?pageIndex="+pageIndex+"&pageSize="+pageSize;
          var params =jQuery("#queryForm").serialize();
          params=decodeURIComponent(params,true); 
          jQuery("#userContent").load(url+"&"+ encodeURI(encodeURI(params)));
     }

     function gotoPage(pageSize)
     {
        var pageIndex =jQuery("#pageIndex").val();
        queryUserForm(pageIndex,pageSize);
     }

     function addUser()
     {
         location.href=base+"/userMain/toRegUser.do";
     }
  
     function editUserInfo(id)
     {
         location.href=base+"/userMain/toEditUser.do?userId="+id;
     }


     function statisticsUserInfo(id)
     {
          var url =base + "/userMain/statisticsUser.do?uid="+id;
          jQuery.layer({
           type: 2,
           border: [0],
           title: false,
           shadeClose: true,
           closeBtn: true,
           iframe: {src : url},
           area: ['346px' , '374px'] 
          }); 
     }

     // 充值 
function doRecharge(userId)
{
       var url =base + "/userMain/doRecharge.do?userId="+userId;
       jQuery.layer({
           type: 2,
           border: [0],
           title: false,
           shadeClose: true,
           closeBtn: true,
           iframe: {src : url},
           area: ['376px' , '436px'] 
          }); 
}


function toSetAcomm(userId)
{
    var url =base + "/userMain/toSetAcomm.do?id="+userId;
    jQuery.layer({
        type: 2,
        border: [0],
        title: false,
        shadeClose: true,
        closeBtn: true,
        iframe: {src : url},
        area: ['366px' , '379px'] 
       }); 
}


function setAcomm()
{
    jQuery("#commForm").ajaxSubmit(
            {
               type:"post",
               clearForm: true,        // 是否清空form  
               resetForm: true,       // 是否重置form  
               success:function(data)
               { 
                  var d= eval("("+data+")");
                  if(d.STATUS=="0")
                  {
                     alert("保存成功!");
                     window.parent.queryUserForm(1,15);
                     closeWin();
                  }
                  else
                  {
                     alert(d.MSG);
                  }
               }
            }
           );
}

function clearAcomm(userId)
{
     if(window.confirm("确定要归零该用户的活动佣金?"))
     {
           jQuery.post(
                      base+"/userMain/clearAcomm.do",
                      {uid:userId},
                      function(result){
                             var d= eval("("+result+")");
                  if(d.STATUS=="0")
                  {
                     alert("操作成功!");
                      queryUserForm(1,15); 
                  }
                  else
                  {
                     alert(d.MSG);
                  }
               });
     }
	
}

// 查询当前用户的下级代理
function subProxy(uid)
{
      var url =base+"/userMain/pagingUserSubProxy.do?uid="+uid+"&pageIndex=1&pageSize=100";
          //var params =jQuery("#queryForm").serialize();
          //params=decodeURIComponent(params,true); 
          jQuery("#userContent").load(url);
}